---------------------------------------------------------------------------------------------------------------------------------------------
-- Create Database
---------------------------------------------------------------------------------------------------------------------------------------------
CREATE DATABASE BishoyPhoto
GO

USE BishoyPhoto
GO

---------------------------------------------------------------------------------------------------------------------------------------------
-- Create Tables
---------------------------------------------------------------------------------------------------------------------------------------------

CREATE TABLE [dbo].[Contact](
	[ID] [int] IDENTITY(1,1) NOT NULL CONSTRAINT [PK_Contact] PRIMARY KEY,
	[Name] [varchar](100) NOT NULL,
	[Email] [varchar](40) NOT NULL,
	[Mobile] [varchar](20) NULL
)
GO

CREATE TABLE [dbo].[Gallery](
	[ID] [int] IDENTITY(1,1) NOT NULL CONSTRAINT [Gallery_PrimaryKey] PRIMARY KEY,
	[Name] [nvarchar](200) NOT NULL,
	[Order] [int] NOT NULL,
	[Password] [nvarchar](8) NULL,
	[Description] [nvarchar](500) NOT NULL,
	[ArchiveURL] [varchar](256) NULL
)
GO

CREATE TABLE [dbo].[Photo](
	[ID] [int] IDENTITY(1,1) NOT NULL CONSTRAINT [Photo_PrimaryKey] PRIMARY KEY,
	[Title] [nvarchar](200) NOT NULL,
	[Description] [nvarchar](500) NOT NULL,
	[Order] [int] NOT NULL,
	[Location] [nvarchar](512) NOT NULL CONSTRAINT [IX_Photo_Location] UNIQUE,
	[GalleryID] [int] NULL CONSTRAINT [FK_Photo_Gallery] FOREIGN KEY REFERENCES [dbo].[Gallery] ([ID]),
	[SlideShow] [bit] NOT NULL CONSTRAINT [DF_Photo_SlideShot]  DEFAULT ((0)),
	[SlideShowOrder] [int] NULL
)
GO

CREATE TABLE [dbo].[Admin](
	[ID] [int] IDENTITY(1,1) NOT NULL CONSTRAINT [Admin_PrimaryKey] PRIMARY KEY,
	[FullName] [nvarchar](200) NOT NULL,
	[Username] [nvarchar](20) NOT NULL CONSTRAINT [Admin_UniqueKey] UNIQUE,
	[Password] [nvarchar](20) NOT NULL,
	[Email] [nvarchar](128) NOT NULL
)
GO

---------------------------------------------------------------------------------------------------------------------------------------------
-- Create Stored Procedures
---------------------------------------------------------------------------------------------------------------------------------------------

CREATE PROC [dbo].[GetAdmin] (@Username AS nvarchar(20), @Password AS nvarchar(20))
AS
	SELECT [ID], [FullName], [Email] FROM [Admin] WHERE [Username] = @Username AND [Password] = @Password
GO

CREATE PROC [dbo].[AddGallery] (@Name AS nvarchar(200), @Order AS int, @Password AS nvarchar(8), @Description AS nvarchar(500), @ArchiveURL AS varchar(256))
AS
INSERT INTO [dbo].[Gallery]
           ([Name]
           ,[Order]
           ,[Password]
           ,[Description]
           ,[ArchiveURL])
     VALUES
           (@Name
           ,@Order
           ,@Password
           ,@Description
           ,@ArchiveURL)
GO

CREATE PROC [dbo].[AddPhoto] (@Title AS nvarchar(200)
           ,@Description AS nvarchar(500)
           ,@Location AS nvarchar(512)
           ,@GalleryID AS int
           ,@SlideShow AS bit)
AS

DECLARE @NextOrder as int
DECLARE @NextSlideShowOrder as int

SET @NextOrder = ISNULL((SELECT MAX([Order]) FROM [dbo].[Photo] WHERE [GalleryID] = @GalleryID), 0) + 1
SET @NextSlideShowOrder = ISNULL((SELECT MAX([SlideShowOrder]) FROM [dbo].[Photo]), 0) + 1

INSERT INTO [dbo].[Photo]
           ([Title]
           ,[Description]
           ,[Order]
           ,[Location]
           ,[GalleryID]
           ,[SlideShow]
           ,[SlideShowOrder])
     VALUES
           (@Title
           ,@Description
           ,@NextOrder
           ,@Location
           ,@GalleryID
           ,@SlideShow
           ,CASE @SlideShow WHEN 0 THEN NULL ELSE @NextSlideShowOrder END)
GO

CREATE PROC [dbo].[DeletePhoto] (@ID int)
AS
DELETE FROM [dbo].[Photo] WHERE ID = @ID
GO

CREATE PROC GetContacts
AS
SELECT [ID]
      ,[Name]
      ,[Email]
      ,[Mobile]
  FROM [dbo].[Contact]
GO

CREATE PROC [dbo].[GetGalleryPhotos] (@GalleryID AS int)
AS
SELECT [ID]
      ,[Title]
      ,[Description]
      ,[Location]
  FROM [dbo].[Photo]
  WHERE [GalleryID] = @GalleryID
  ORDER BY [Order]
GO

CREATE PROC [dbo].[GetPrivateGalleries] AS
SELECT [ID]
      ,[Name]
      ,[Description]
      ,[Password]
      ,[ArchiveURL]
  FROM [dbo].[Gallery]
  WHERE [Password] IS NOT NULL
  ORDER BY [dbo].[Gallery].[Order]
GO

CREATE PROC [dbo].[GetPublicGalleries] AS
SELECT [dbo].[Gallery].[ID]
      ,[Name]
      ,[dbo].[Gallery].[Description]
      ,MAX([Location]) AS [CoverImage]
  FROM [dbo].[Gallery]
  INNER JOIN [dbo].[Photo] ON [dbo].[Gallery].[ID] = [dbo].[Photo].[GalleryID]
  AND [dbo].[Photo].[Order] = 1
  WHERE [Password] IS NULL
  GROUP BY [dbo].[Gallery].[ID], [dbo].[Gallery].[Order], [Name],[dbo].[Gallery].[Description]
  ORDER BY [dbo].[Gallery].[Order]
GO

CREATE PROC [dbo].[GetSlideShowPhotos]
AS
SELECT [ID]
      ,[Title]
      ,[Description]
      ,[Location]
  FROM [dbo].[Photo]
  WHERE [SlideShow] = 1
  ORDER BY [SlideShowOrder]

GO

CREATE PROC [dbo].[UpdateGallery] (@ID int, @Name AS nvarchar(200), @Order AS int, @Password AS nvarchar(8), @Description AS nvarchar(500), @ArchiveURL AS varchar(256))
AS

IF @Name IS NOT NULL BEGIN UPDATE [dbo].[Gallery] SET [Name] = @Name WHERE ID = @ID END
IF @Order IS NOT NULL BEGIN UPDATE [dbo].[Gallery] SET [Order] = @Order WHERE ID = @ID END
IF @Password IS NOT NULL BEGIN UPDATE [dbo].[Gallery] SET [Password] = @Password WHERE ID = @ID END
IF @Description IS NOT NULL BEGIN UPDATE [dbo].[Gallery] SET [Description] = @Description WHERE ID = @ID END
IF @ArchiveURL IS NOT NULL BEGIN UPDATE [dbo].[Gallery] SET [ArchiveURL] = @ArchiveURL WHERE ID = @ID END
GO

CREATE PROC [dbo].[UpdatePhoto] (@ID AS int
      ,@Title AS nvarchar(200)
      ,@Description AS nvarchar(500)
      ,@Order AS int
      ,@Location AS nvarchar(512)
      ,@GalleryID AS int
      ,@SlideShow AS bit
      ,@SlideShowOrder AS int)
AS

IF @Title IS NOT NULL BEGIN UPDATE [dbo].[Photo] SET [Title] = @Title WHERE ID = @ID END
IF @Description IS NOT NULL BEGIN UPDATE [dbo].[Photo] SET [Description] = @Description WHERE ID = @ID END
IF @Location IS NOT NULL BEGIN UPDATE [dbo].[Photo] SET [Location] = @Location WHERE ID = @ID END
IF @Order IS NOT NULL BEGIN UPDATE [dbo].[Photo] SET [Order] = @Order WHERE ID = @ID END
IF @SlideShow IS NOT NULL BEGIN UPDATE [dbo].[Photo] SET [SlideShow] = @SlideShow WHERE ID = @ID END
IF @SlideShowOrder IS NOT NULL BEGIN UPDATE [dbo].[Photo] SET [SlideShowOrder] = @SlideShowOrder WHERE ID = @ID END
GO

---------------------------------------------------------------------------------------------------------------------------------------------
-- Construct Data
---------------------------------------------------------------------------------------------------------------------------------------------

SET IDENTITY_INSERT [dbo].[Contact] ON
GO

INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(1,convert(text, N'Meer Farag' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'meerfarag@metropharm.com.au' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(2,convert(text, N'Joseph Rezkalla' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'jossepii@hotmail.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(3,convert(text, N'Miriam Michael' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'drmiriamm@yahoo.co.uk' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(4,convert(text, N'Michael Wahib' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'dr_michaelwahib@hotmail.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(5,convert(text, N'Samuel Maher' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'tabikh15@hotmail.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(6,convert(text, N'Sarah Nabil' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'sarah.roman86@yahoo.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(7,convert(text, N'Caroline Naguib' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'caramella_farid@yahoo.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(8,convert(text, N'Sherine Gamal' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'dr.sherrygamal@hotmail.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(9,convert(text, N'Michael Farid' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'michael_farid@hotmail.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(10,convert(text, N'Samer Morcos' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'drsamer2005@yahoo.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(11,convert(text, N'Radwa Philip' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'radwa.fehr@gmail.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(12,convert(text, N'Inas Anton' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'drnoussa@yahoo.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(13,convert(text, N'Emad Ghobrial' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'drghemad@yahoo.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(14,convert(text, N'Bassem Adel' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'bassem.bichara@gmail.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(15,convert(text, N'Fady Philip' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'dr_fady_philip@yahoo.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(16,convert(text, N'Joseph' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'joseph_fym@hotmail.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(17,convert(text, N'Maggie' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'maggie_fgi@hotmail.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(18,convert(text, N'Usama George' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'usamageorge@gmail.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(19,convert(text, N'George Georgy' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'george.georgy@au.abb.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
INSERT INTO [dbo].[Contact]([ID],[Name],[Email],[Mobile]) VALUES(20,convert(text, N'George El Kommos' collate SQL_Latin1_General_CP1_CI_AS),convert(text, N'george_elkomos@yahoo.com' collate SQL_Latin1_General_CP1_CI_AS),NULL)
GO

SET IDENTITY_INSERT [dbo].[Contact] OFF
GO

SET IDENTITY_INSERT [dbo].[Gallery] ON
GO

INSERT INTO [dbo].[Gallery]([ID],[Name],[Order],[Password],[Description],[ArchiveURL]) VALUES(1,N'Babies & Newborn',1,NULL,N'',NULL)
INSERT INTO [dbo].[Gallery]([ID],[Name],[Order],[Password],[Description],[ArchiveURL]) VALUES(2,N'Christenings',2,NULL,N'',NULL)
INSERT INTO [dbo].[Gallery]([ID],[Name],[Order],[Password],[Description],[ArchiveURL]) VALUES(3,N'Birthdays',3,NULL,N'',NULL)
INSERT INTO [dbo].[Gallery]([ID],[Name],[Order],[Password],[Description],[ArchiveURL]) VALUES(4,N'From Life',4,NULL,N'',NULL)
INSERT INTO [dbo].[Gallery]([ID],[Name],[Order],[Password],[Description],[ArchiveURL]) VALUES(5,N'Wildlife',5,NULL,N'',NULL)
INSERT INTO [dbo].[Gallery]([ID],[Name],[Order],[Password],[Description],[ArchiveURL]) VALUES(6,N'Products',6,NULL,N'',NULL)
INSERT INTO [dbo].[Gallery]([ID],[Name],[Order],[Password],[Description],[ArchiveURL]) VALUES(7,N'Weddings',1,NULL,N'',NULL)
GO

SET IDENTITY_INSERT [dbo].[Gallery] OFF
GO

SET IDENTITY_INSERT [dbo].[Photo] ON
GO

INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(6,N'It''s a new life',N'Christening of Gabriella',1,N'http://farm6.static.flickr.com/5016/5563552849_4a3af3c791_z.jpg',2,1,3)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(7,N'Born again',N'Christening of Gabriella',2,N'http://farm6.static.flickr.com/5256/5563551323_a21235fa07_z.jpg',2,1,3)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(9,N'A Horse',N'Collins Park - NSW',1,N'http://farm6.static.flickr.com/5090/5320197704_2a472b3d34_z.jpg',5,1,21)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(10,N'Lizard',N'Symbio Park - NSW',2,N'http://farm6.static.flickr.com/5085/5375345388_d7139ccdb8_z.jpg',5,1,20)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(11,N'Tortoise',N'Symbio Park - NSW',3,N'http://farm6.static.flickr.com/5003/5375340214_8d021945c5_z.jpg',5,1,19)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(12,N'Earings',N'Still life photography',1,N'http://farm6.static.flickr.com/5210/5267911729_9f70d95ee4_z.jpg',6,1,18)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(14,N'Smile',N'Birthday of Jacob',10,N'http://farm5.static.flickr.com/4085/5020484544_fa1ff0e5da_z.jpg',3,1,4)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(15,N'Kiko',N'Christening of Nicole',3,N'http://farm5.static.flickr.com/4008/4659310008_78b60734a5_z.jpg',2,1,15)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(16,N'Fly',N'Montazah',4,N'http://farm4.static.flickr.com/3271/3796726476_147cb2f91a_z.jpg',4,1,16)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(18,N'Natalie',N'2 days newborn - Canterbury Hospital',8,N'http://farm6.static.flickr.com/5291/5425107564_258565cb24_z.jpg',1,0,0)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(19,N'Walk',N'Red Sea',1,N'http://farm4.static.flickr.com/3528/3946904532_7ef010ced5_z.jpg',4,1,9)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(20,N'Love',N'Red Sea',2,N'http://farm3.static.flickr.com/2645/3946873414_fe59a5cd04_z.jpg',4,1,8)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(21,N'Memories',N'Montazah',3,N'http://farm3.static.flickr.com/2504/3767151643_cdac370f4c_z.jpg',4,1,17)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(24,N'Treats',N'Birthday of Johnathan',11,N'http://farm6.static.flickr.com/5185/5615533143_7b7773fb71_z.jpg',3,0,0)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(26,N'Birthday',N'Birthday of Iriny',3,N'http://farm6.static.flickr.com/5061/5616115076_5459317fa5_z.jpg',3,0,0)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(27,N'Cake',N'Birthday of Johnathan',1,N'http://farm6.static.flickr.com/5102/5616114550_31c5174e84_z.jpg',3,1,5)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(28,N'The Gang',N'Birthday of Parthena',4,N'http://farm6.static.flickr.com/5103/5615536195_167e543f4b_z.jpg',3,0,0)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(29,N'Here comes Parthena',N'Birthday of Parthena',6,N'http://farm6.static.flickr.com/5223/5616116166_f2e660462f_z.jpg',3,0,0)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(30,N'Parthena',N'Birthday of Parthena',7,N'http://farm6.static.flickr.com/5225/5615538489_5a4387e55f_z.jpg',3,0,0)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(31,N'Parthena with friends',N'Birthday of Parthena',8,N'http://farm6.static.flickr.com/5190/5616118510_f61ac27063_z.jpg',3,1,10)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(32,N'Iriny',N'Birthday of Parthena',9,N'http://farm6.static.flickr.com/5187/5616122262_0f6d7e49f3_z.jpg',3,1,11)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(33,N'Getting Ready',N'Birthday of Parthena',5,N'http://farm6.static.flickr.com/5104/5615539725_1a53bc91b0_z.jpg',3,0,0)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(34,N'Johnathan',N'Christening of Mellissa',8,N'http://farm6.static.flickr.com/5064/5615541615_ecda44e883_z.jpg',2,1,12)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(35,N'Cake',N'Christening of Gabriella',4,N'http://farm6.static.flickr.com/5267/5616122588_05451d686f_z.jpg',2,1,13)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(36,N'Gabriella',N'Christening',5,N'http://farm6.static.flickr.com/5225/5616123110_92eaffeddf_z.jpg',2,1,6)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(37,N'Mellissa',N'Christening',6,N'http://farm6.static.flickr.com/5147/5615542203_17bedbefb2_z.jpg',2,0,0)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(38,N'Piano',N'Christening of Gabriella',9,N'http://farm6.static.flickr.com/5065/5615543377_df02785cb5_z.jpg',2,1,23)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(39,N'Mellissa',N'Christening',7,N'http://farm6.static.flickr.com/5061/5615542491_f01658857e_z.jpg',2,0,0)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(43,N'Monica',N'2 weeks newborn session',5,N'http://farm6.static.flickr.com/5104/5683303534_ee114daaa8_z.jpg',1,1,6)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(44,N'Monica',N'2 weeks newborn session',7,N'http://farm6.static.flickr.com/5146/5683302450_5956f1e9b5_z.jpg',1,0,0)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(45,N'Natalie',N'3 month baby session',1,N'http://farm6.static.flickr.com/5067/5696475680_5db3759711_z.jpg',1,1,1)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(47,N'Natalie',N'3 month baby sesion',2,N'http://farm3.static.flickr.com/2008/5709784735_7d3d05dc6a_z.jpg',1,1,2)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(48,N'Natalie',N'3 month baby session',3,N'http://farm3.static.flickr.com/2742/5710345784_53824a6cda_z.jpg',1,1,15)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(49,N'Natalie',N'3 month baby session',4,N'http://farm3.static.flickr.com/2566/5709779735_30e19bc7c9_z.jpg',1,0,0)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(50,N'Monica',N'2 weeks newborn session',6,N'http://farm6.static.flickr.com/5145/5683305378_f1b3f57b8c_z.jpg',1,1,15)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(51,N'In Priest Hands',N'At Monica First Shower',10,N'http://farm7.static.flickr.com/6023/5876573169_60bcbdfb2d_z.jpg',2,1,18)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(53,N'Reflection',N'Nancy & Hany Wedding',1,N'http://farm6.static.flickr.com/5223/5877138414_0fcbef2e37_z.jpg',7,1,4)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(54,N'The Crown',N'Nancy & Hany Wedding',2,N'http://farm6.static.flickr.com/5184/5876590105_c91a607c6f_z.jpg',7,1,4)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(55,N'Man & Wife',N'Nancy & Hany Wedding',3,N'http://farm6.static.flickr.com/5159/5877159176_f68b7f50c5_z.jpg',7,1,7)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(56,N'Mum & Daughter',N'Parthena and Mother at the Park',12,N'http://farm6.static.flickr.com/5155/5876603877_48cab268f5_z.jpg',3,1,22)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(57,N'Eupraxia',N'',1,N'http://farm7.static.flickr.com/6072/6072670381_137e785ffa_z.jpg',1,1,1)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(58,N'Eupraxia',N'',1,N'http://farm7.static.flickr.com/6210/6073207536_31330b19c3_z.jpg',1,1,1)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(59,N'Eupraxia',N'',1,N'http://farm7.static.flickr.com/6074/6073210432_51e3efcda4_z.jpg',1,1,1)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(60,N'Dad',N'',1,N'http://farm7.static.flickr.com/6122/5953672747_852011ff1d_z.jpg',1,1,1)
INSERT INTO [dbo].[Photo]([ID],[Title],[Description],[Order],[Location],[GalleryID],[SlideShow],[SlideShowOrder]) VALUES(61,N'Gabriella',N'',1,N'http://farm7.static.flickr.com/6020/5937043370_c94b8cc782_z.jpg',1,1,1)
GO

INSERT INTO [dbo].[Admin]([FullName], [Username], [Password], [Email]) VALUES(N'Bishoy Botros', N'bishoy', N'Virgin3', N'photography@bishoy.com.au')
INSERT INTO [dbo].[Admin]([FullName], [Username], [Password], [Email]) VALUES(N'Margret Botros', N'margret', N'Mariam', N'margret@bishoyphotography.com')
GO

SET IDENTITY_INSERT [dbo].[Photo] OFF
GO

